<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>缺货记录</title>
<script type="text/javascript" src="../boot.js"></script>
<script>
var tbgrid;

function parsePage(){
$('#toolbar').toolbar({
	items: [{
				text : '发送缺/到货通知',
				iconCls : 'icon-add',
				handler : function() {
					add();
				}
			},'-',{
				text : '导入',
				iconCls:'icon-import',
				handler : function() {
					exportBrand();
				}
			},'-',{
				text : '导出',
				iconCls:'icon-export',
				handler : function() {
					exportBrand();
				}
			}] 
});


toolSearch({
	items:[{"text":"商品编码","name":"goodsno"},{"text":"商品简称","name":"goodsno"}],
	callback:function(key,name){
			if(key==""){
				showInfo('请输入关键字');
				return;
			}
		showInfo(key);
	}
});	

tbgrid = $('#tbList').datagrid({
			url: '../json/goods/goods-quehuo.json?r='+Math.random(),
			frozenColumns : [[{
				title : 'id',
				field:'id',
				width : 150,
				checkbox : true
			}]],
		    columns:[[
					{
					title:'商品编号',
					field:'col1',
					width:120,
					sortable:true
				    },
					{
					title:'商品名称',
					field:'col2',
					width:250,
					align:'left'
					},{
					title:'商品图片',
					field:'col3',
					width:180,
					formatter:function(value,rec,index){
						var str='<img src="'+value+'"  width="40" height="40" />';
						return str;
					}
					},{
					title:'客户信息',
					field:'col4',
					width:120
					},{
					title:'登记时间',
					field:'col5',
					width:120
					},{
					title:'通知时间',
					field:'col6',
					width:120
					},{
					title:'到货状态',
					field:'col7',
					width:100,
					formatter:function(value,rec,index){
							return	(value==0)?"未到货":"已到货";
					}
					},{
					title:'状态',
					field:'col8',
					width:100,
					formatter:function(value,rec,index){
						return	(value==0)?"未通知":"已通知";
					}
					}
		]],
		onLoadSuccess:function(){
			//编辑
			$('.jsEdit').click(function(){
				var _this=$(this);
				return false;
			});
			
			//删除
			$('.jsDel').click(function(){
				var id=$(this).attr('data-id');
				del(id);
				return false;
			});
			
		}

	});





}


function del(id){
	if(id.length<=0){
		showError('请选择需要删除的项目！');
		return;
	}
	showConfirm('确认删除吗？',function(){					 
showSuc('删除成功！'+id);						$('#tbList').datagrid('reload');
				  
	});
}


function add(){
	parent.addBlankTab({title:'添加货品',href:'goods/goods-add.html'});
}

//导出
function exportGoods(){
	
}
</script>
</head>

<body class="easyui-layout">
<div data-options="region:'north',border:false" class="toolbar-region">
    <div id="toolbar">
    </div>
</div>
<div  data-options="region:'center',border:false">
    <div class="easyui-layout" data-options="fit:true" id="subLayout">
        <!--搜索start-->
        <div data-options="region:'north',border:false,closed:true" >
            <div class="search-div">
                <form name="searchForm" id="searchForm" action="" method="post" >
                    <p>
                        <label> <em>商品名称：</em> <input class="ipt" /> </label>
                        <label> <em>商品品牌：</em> <input class="ipt" /> </label>
                        <label> <em>上架时间：</em> <input class="ipt easyui-datebox w80" /> </label>
                        <a class="easyui-linkbutton ml10" id="SearchBtn">搜索</a>
                    </p>
                </form>
            </div>
        </div>
        <!--搜索end--> 
        <!--列表-->
        <div data-options="region:'center',border:false">
            <table id="tbList">
            </table>
        </div>
    </div>
    <!--subLayout end-->
</div>
</body>
</html>
